﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Crossborder.Core.Migrations
{
    /// <inheritdoc />
    public partial class _250716init : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "User",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserId = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "用户Id"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "用户名"),
                    NickName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "昵称"),
                    Role = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "角色"),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "邮箱"),
                    CreateDate = table.Column<DateTime>(type: "dateTime2", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "dateTime2", nullable: false),
                    IsEnabled = table.Column<bool>(type: "bit", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_User", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserPassword",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserId = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "用户Id"),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "密码"),
                    CreateDate = table.Column<DateTime>(type: "dateTime2", nullable: false),
                    ModifyDate = table.Column<DateTime>(type: "dateTime2", nullable: false),
                    IsEnabled = table.Column<bool>(type: "bit", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserPassword", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "User");

            migrationBuilder.DropTable(
                name: "UserPassword");
        }
    }
}
